<?php
// action manage the locations for tour
$tour = new Tour();
$tour->select($tour_id);
$locations = $tour->getAllLocations();
?>
<a href="?act=add_location_for_tour&tour_id=<?php echo $tour_id?>"><img src="images/add_new.gif">Thêm Dia Diem</img></a>
<table class="tb_table" width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr class="tb_head">
	<td>Thứ Tự</td>
	<td>Ma Dia Diem</td>
    <td>Tên Dia Diem</td>
    <td>Quoc Gia</td>
    <td>Mo ta</td>
  </tr>
	<?php $index = 0 ?>
	<?php foreach ($locations as $location) {?>
		<?php $index++?>
  		<tr class="tb_content">
			<td><?php echo $index ?></td>
			<td><?php echo $location->getcode() ?></td>
			<td><?php echo $location->getname() ?></td>
			<td><?php $country = new Country(); $country->select($location->getcountry()); echo $country->getname(); ?></td>
			<td><?php echo $location->getdescription() ?></td>
			<td><a href="?act=delete_location_from_tour&location_id=<?php echo $location->getid()?>&tour_id=<?php echo $tour_id ?>">Xoa</a></td>
  		</tr>
	<?php } ?>
</table>
<a href="?act=add_location_for_tour&tour_id=<?php echo $tour_id?>"><img src="images/add_new.gif">Thêm Dia Diem</img></a>